package com.dhl.fin.api.service.messageService;

import com.dhl.fin.api.domain.LoginAccount;
import com.dhl.fin.api.dto.TipMessageDTO;
import com.dhl.fin.api.service.LoginAccountService;
import com.dhl.fin.api.service.messageService.superService.RemindTaskAbstract;
import com.dhl.fin.api.service.messageService.superService.SubscribeTimesCountAbstract;

/**
 * @author CuiJianbo
 * @since 2025/6/8
 */
public class TipWillStopMessage extends SubscribeTimesCountAbstract {

    public TipWillStopMessage(LoginAccount loginAccount) {
        this.loginAccount = loginAccount;
    }

    @Override
    public TipMessageDTO tipMessage() {
        int n = loginAccount.getAllowCount() - 1;
        if (n == 0) {
            return TipMessageDTO.builder()
                    .remindType("订阅消息")
                    .remindName("订阅消息已用完")
                    .remindDescription("请手动增加订阅消息次数")
                    .remainTime("0次")
                    .remindWayType("准时提醒")
                    .build();
        } else {
            return TipMessageDTO.builder()
                    .remindType("订阅消息")
                    .remindName("订阅消息次数不足")
                    .remindDescription("请手动增加订阅消息次数")
                    .remainTime(n + "次")
                    .remindWayType("提前提醒")
                    .build();
        }

    }

}
